This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Dec 11, 2012, 2:28 PM
3 Posts

Setting component value not working as expected

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: getComponent
  • Replies: 3
I have the following in the onChange event of the status field .  I am attempting to do a partial update of the date_closed field  but it is not working. 
 
var stat = getComponent("status").getValue();
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var dt = month + "/" + day + "/" + year
if(stat == "GREEN"){
 getComponent("date_closed").setValue(dt);
Dec 12, 2012, 1:01 PM
23 Posts
Re: Setting component value not working as expected
 
Hi Stephen,
 
 
                  The same code which you posted was working fine and I get date in the field. Hopefully check the Partial Update which you added.
 
 
 
Thanks, 
Vidhya Sri
 
 
 
 
Dec 12, 2012, 2:39 PM
3 Posts
Re: Setting component value not working as expected
I was able to make it work by changing the date_closed component to text instead of date/time.  Is there anyway to work with a dat/time field?
Dec 14, 2012, 5:23 AM
23 Posts
Re: Setting component value not working as expected
 
Hi, 
  
              Its even working for Date/Time field. I tested now. Moreover you would have set partial update for a  field. check in which event you set that. I even did customization of dates and it works perfect.
 
 
Thanks. 
 
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal